package com.engine.core.domain;


import java.util.Arrays;
import java.util.List;

public class Condition {
    private String name;// 条件名
    private Opt oper;// 运算符
    private String[] value;// 条件值

    private List<Condition> children;

    private boolean isExp;

    public Condition() {
        super();
    }

    public Condition(String type, String name, String ...value) {
         this(type,name,false,value);
    }

    public Condition(String type, String name, boolean isExp,String ...value){
        this.oper = Opt.getByName(type);
        this.name = name;
        this.value=value;
        this.isExp=isExp;
    }

    public Condition(String type,Condition ...children){
        this.oper = Opt.getByName(type);
        this.children= Arrays.asList(children);
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Opt getOper() {
        return oper;
    }

    public void setOper(Opt oper) {
        this.oper = oper;
    }

    public String[] getValue() {
        return value;
    }

    public void setValue(String[] value) {
        this.value = value;
    }

    public List<Condition> getChildren() {
        return children;
    }

    public void setChildren(List<Condition> children) {
        this.children = children;
    }

    public boolean isExp() {
        return isExp;
    }

    public void setExp(boolean exp) {
        isExp = exp;
    }
}
